import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: Alex
 * Date: 12.06.13
 * Time: 20:58
 * To change this template use File | Settings | File Templates.
 */
abstract class Creature {
    int widthSpace;
    int lengthSpace;
    private Position position;
    Creature(int widthSpace, int lengthSpace) {
        Random rand = new Random();
        position = new Position(rand.nextInt(widthSpace), rand.nextInt(lengthSpace), widthSpace - 1, lengthSpace - 1);
        this.widthSpace = widthSpace - 1;
        this.lengthSpace = lengthSpace - 1;

    }



    Creature() {
        position = new Position(10, 10, 10, 10);
    }

    public Position getPossition() {
        return position;
    }

    public int getXPosition() {
        return position.getPosition("X");
    }

    public int getYPosition() {
        return position.getPosition("Y");
    }

    protected boolean setDirection(Directions direction, int steps) {

        System.out.println(direction);
        switch (direction) {
            case UP: return position.up(steps);
     //           break;
            case DOWN: return position.down(steps);
       //         break;
            case LEFT: return position.left(steps);
      //          break;
            case RIGHT: return position.right(steps);
      //          break;
            case UPRIGHT: return position.upRight(steps);
    //            break;
            case DOWNLEFT: return position.downLeft(steps);
    //            break;
            default:
        }
        return false;
    }



}
